package org.spruice;

/**
 * User: mrettig
 * Date: Mar 24, 2009
 * Time: 2:28:14 PM
 */
public class BeanId implements NamedBean {

    private String id;

    public BeanId(String id) {
        this.id = id;
    }

    public String getName() {
        return id;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        BeanId beanId = (BeanId) o;

        if (id != null ? !id.equals(beanId.id) : beanId.id != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        return id != null ? id.hashCode() : 0;
    }
}
